package com.a01_2021.thousandstimes.general.mapper;

import com.a01_2021.thousandstimes.general.entity.SysRoleMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author FRQ
 * @since 2021-02-22
 */
@Repository
public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> {

    @Insert("<script>" +
            "INSERT INTO sys_role_menu (role_id,menu_id) VALUES" +
            "<foreach item='menuId' collection='list' index='index' separator=','>" +
            "(#{roleId},#{menuId})" +
            "</foreach>" +
            "</script>")
    void insertRoleMenu(@Param("roleId") long roleId, @Param("list") List<Long> menuList);
}
